Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict installed apps upgrade #13086

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

momesgin
Copy link
Member

@momesgin momesgin commented Jan 14, 2025

Summary

Fixes #11679 and #11680

Occurred changes and/or fixed issues

  • Updated the return value of upgradeAvailable to a more meaningful and readable format
  • Added an option to catalog/chart in the store to let returning multiple matching charts
  • matchingChart now looks into the versions array of a matched chart to make sure it's a right match. Since a version is like a snapshot in time, it'll be safe to check the home value against it for an installed app

Areas or cases that should be tested

Unit tests are added to cover different cases for the new approach, but manual tests would be great to make sure it's working as expected.

Make sure cert-manager 1.7.1 is installed by CLI. Then add OCI repo for AppCo. Go to the installed apps page and make sure there's no upgrade available.

Areas which could experience regressions

Install an old version of any apps. Go to the Installed apps page, and check the upgrade is available.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@momesgin momesgin requested a review from nwmac January 14, 2025 00:22
@momesgin momesgin self-assigned this Jan 14, 2025
if ( preferRepoType && preferRepoName ) {
preferSameRepo(matching, preferRepoType, preferRepoName);
if (multiple) {
return matchingCharts;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this's been removed since it was not being used anymore


// Filtering matches by verifying if the current version is in the matched chart's available versions, and that the home value matches as well
const thisHome = chart?.metadata?.home;
const bestMatches = matchingCharts.filter((m) => m.versions.some((v) => v.version === this.currentVersion && v.home === thisHome));
Copy link
Member Author

@momesgin momesgin Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nwmac as we discussed, I've updated the filtering logic, and it seems to be working well. The only drawback is that it's a bit expensive since it requires iterating through the versions array.

Copy link
Member Author

@momesgin momesgin Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've optimized the iteration through versions a bit

@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.11.0 milestone Jan 20, 2025
@momesgin momesgin marked this pull request as ready for review January 20, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm App Upgrade: Use more fields when trying to find the correct matching chart for an app
1 participant